﻿CREATE TABLE [Core].[ContactUser] (
    [ContactId]                              UNIQUEIDENTIFIER NOT NULL,
    [OpenIDUserName]                         NVARCHAR (255)   NULL,
    [Password]                               NVARCHAR (127)   NOT NULL,
    [Comment]                                NVARCHAR (255)   NULL,
    [SecurityQuestion]                       NVARCHAR (127)   NULL,
    [SecurityAnswer]                         NVARCHAR (127)   NULL,
    [InviteCode]                             NVARCHAR (10)    NULL,
    [InviteExpires]                          DATETIME         NULL,
    [IsDroppedYN]                            NCHAR (1)        NOT NULL,
    [IsApprovedYN]                           NCHAR (1)        NOT NULL,
    [IsOnLineYN]                             NCHAR (1)        NOT NULL,
    [IsLockedOutYN]                          NCHAR (1)        NOT NULL,
    [CreateDT]                               DATETIME         NOT NULL,
    [LastLoginDT]                            DATETIME         NULL,
    [LastActivityDT]                         DATETIME         NULL,
    [LastPasswordChangedDT]                  DATETIME         NULL,
    [LastLockedOutDT]                        DATETIME         NULL,
    [FailedPasswordAttemptCount]             INT              NOT NULL,
    [FailedPasswordAttemptWindowStart]       DATETIME         NULL,
    [FailedPasswordAnswerAttemptCount]       INT              NOT NULL,
    [FailedPasswordAnswerAttemptWindowStart] DATETIME         NULL
);

